package com.yuyou.fn.tms.vo;

import com.yuyou.fn.educational.entity.CourseOrder;
import com.yuyou.fn.educational.entity.StudentReg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@ApiModel("报名对应订单")
public class TmsRegOrder {

    @ApiModelProperty("订单id")
    private Long finOrderId ;//订单id

    @ApiModelProperty("学生ID")
    private Long finOrderStuId ;//学生ID

    @ApiModelProperty("学生名字")
    private String finOrderStuName ;//学生名字

    @ApiModelProperty("0未交费1已缴费2欠费")
    private int finOrderStatus ;//0未交费1已缴费2欠费

    @ApiModelProperty("0正常1撤销2删除3退费")
    private int finOrderIsCancel ;//0正常1撤销2删除3退费

    @ApiModelProperty("2报名缴费")
    private String finOrderType ;//2报名缴费

    @ApiModelProperty("原价（总金额）")
    private BigDecimal finOrderPrice ;//原价（总金额）

    @ApiModelProperty("已缴")
    private BigDecimal finOrderPayPrice ;//已缴

    @ApiModelProperty("优惠总额")
    private BigDecimal finOrderDis ;//优惠总额

    @ApiModelProperty("创建时间")
    private Date finOrderCreateDate ;//创建时间

    @ApiModelProperty("修改时间")
    private Date finOrderModifyDate ;//修改时间

    @ApiModelProperty("订单创建人名")
    private String orderCreatorName ;//订单创建人名

    @ApiModelProperty("咨询师ID")
    private Long orderCounselorId ;

    @ApiModelProperty("咨询师名字")
    private String orderCounselorName ;

    public TmsRegOrder(CourseOrder courseOrder ) {

        this.setFinOrderId(courseOrder.getCourseOrderId());
        this.setFinOrderStuId(courseOrder.getStudentId());
        this.setFinOrderStuName(courseOrder.getStudentName());
        if(courseOrder.getChargingStatus() == 0 ){
            this.setFinOrderStatus( 0 );
        }else if(courseOrder.getChargingStatus() == 1 ){
            this.setFinOrderStatus(2);
        }else if(courseOrder.getChargingStatus() == 2 ){
            this.setFinOrderStatus(1);
        }else if(courseOrder.getChargingStatus() == 4 ){
            this.setFinOrderStatus(0);
        }else{
            this.setFinOrderStatus(0);
        }
        this.setFinOrderIsCancel(courseOrder.getChargingStatus() < 4 ? 0 : 1 );
        this.setFinOrderType("2");
        this.setFinOrderPrice(courseOrder.getTotalAmount());
        this.setFinOrderPayPrice(courseOrder.getPaidAmount());
        this.setFinOrderDis(courseOrder.getTotalAmount().subtract( courseOrder.getPayableAmount() ));
        this.setFinOrderCreateDate(courseOrder.getCreateTime());
        this.setFinOrderModifyDate(courseOrder.getUpdateTime());
        this.setOrderCreatorName(courseOrder.getOperator());

    }


    public Long getFinOrderId() {
        return finOrderId;
    }

    public void setFinOrderId(Long finOrderId) {
        this.finOrderId = finOrderId;
    }

    public Long getFinOrderStuId() {
        return finOrderStuId;
    }

    public void setFinOrderStuId(Long finOrderStuId) {
        this.finOrderStuId = finOrderStuId;
    }

    public String getFinOrderStuName() {
        return finOrderStuName;
    }

    public void setFinOrderStuName(String finOrderStuName) {
        this.finOrderStuName = finOrderStuName;
    }

    public int getFinOrderStatus() {
        return finOrderStatus;
    }

    public void setFinOrderStatus(int finOrderStatus) {
        this.finOrderStatus = finOrderStatus;
    }

    public int getFinOrderIsCancel() {
        return finOrderIsCancel;
    }

    public void setFinOrderIsCancel(int finOrderIsCancel) {
        this.finOrderIsCancel = finOrderIsCancel;
    }

    public String getFinOrderType() {
        return finOrderType;
    }

    public void setFinOrderType(String finOrderType) {
        this.finOrderType = finOrderType;
    }

    public BigDecimal getFinOrderPrice() {
        return finOrderPrice;
    }

    public void setFinOrderPrice(BigDecimal finOrderPrice) {
        this.finOrderPrice = finOrderPrice;
    }

    public BigDecimal getFinOrderPayPrice() {
        return finOrderPayPrice;
    }

    public void setFinOrderPayPrice(BigDecimal finOrderPayPrice) {
        this.finOrderPayPrice = finOrderPayPrice;
    }

    public BigDecimal getFinOrderDis() {
        return finOrderDis;
    }

    public void setFinOrderDis(BigDecimal finOrderDis) {
        this.finOrderDis = finOrderDis;
    }

    public Date getFinOrderCreateDate() {
        return finOrderCreateDate;
    }

    public void setFinOrderCreateDate(Date finOrderCreateDate) {
        this.finOrderCreateDate = finOrderCreateDate;
    }

    public Date getFinOrderModifyDate() {
        return finOrderModifyDate;
    }

    public void setFinOrderModifyDate(Date finOrderModifyDate) {
        this.finOrderModifyDate = finOrderModifyDate;
    }

    public String getOrderCreatorName() {
        return orderCreatorName;
    }

    public void setOrderCreatorName(String orderCreatorName) {
        this.orderCreatorName = orderCreatorName;
    }

    public Long getOrderCounselorId() {
        return orderCounselorId;
    }

    public void setOrderCounselorId(Long orderCounselorId) {
        this.orderCounselorId = orderCounselorId;
    }

    public String getOrderCounselorName() {
        return orderCounselorName;
    }

    public void setOrderCounselorName(String orderCounselorName) {
        this.orderCounselorName = orderCounselorName;
    }
}
